{%- assign __locale = site.data.locale.ARTICLE_LIST_DATE_FORMAT -%}
{%- include snippets/locale-to-string.html -%}
{%- assign _format = __return -%}
{%- assign post_count = site.posts | size -%}
{%- if post_count < 1 -%}
{}
{%- else -%}
{
  {%- for post in site.posts -%}
    {%- assign currentdate = post.date | date: '%Y' -%}
    {%- if currentdate != date -%}
      {%- unless forloop.first -%}],{%- endunless -%}
      "{{ currentdate }}":[{
      {%- assign date = currentdate -%}
    {%- else -%},{
    {%- endif -%}
      "key":"{{ forloop.index }}","title":"{{ post.title | url_encode }}","tags":[
    {%- for tag in post.tags -%}
      "{{ tag | url_encode }}" {%- unless forloop.last -%},{%- endunless -%}
    {%- endfor -%}
    {%- assign __path = post.url -%}
    {%- include snippets/prepend-baseurl.html -%}
    {%- assign _url = __return -%}
      ],"url":"{{ _url | url_encode }}","date":"{{ post.date | date: _format }}"}
  {%- endfor -%}
]}
{%- endif -%}